import 'package:get/get.dart';
import 'package:xinxuan/http/http_util_service.dart';
import 'package:xinxuan/vo/gift_order_detail_vo.dart';
import 'package:xinxuan/vo/gift_order_list_vo.dart';

class GiftOrderDetailPageController extends GetxController {

  int orderId = 0;
  var giftOrderItem = GiftOrderItem(id: 0).obs;
  
  @override
  void onReady() {
    Map<String, dynamic> argumentsMap = Get.arguments;
    orderId = argumentsMap['orderId'];
    getGiftOrderDetail();
    super.onReady();
  }

  /// 获取订单详情
  getGiftOrderDetail() async {
    GiftOrderDetailVo giftOrderDetailVo = await HttpUtilService.getGiftOrderDetail(orderId: orderId);
    giftOrderItem.value = giftOrderDetailVo.data!;
    update();
  }

}